<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

    <script >
        /**
         * item 迭代的元素
         * index 
         * 
         */
        



        //  const array = [100,200,300]
        //  function showItem(item,index){
        //      console.log("item "+item+"   index = "+index)
        // }
        //  for (let d = 0; d < array.length; d++) {
        //     const item = array[d];
        //     showItem(item,d)
        //  }


        // const array = [100,200,300]
        // function showItem(item,index){
        //      console.log("item "+item+"   index = "+index)
        // }
        // array.forEach(showItem)




        // const array = [100,200,300]
        // array.forEach(function showItem(item,index){
        //      console.log("item "+item+"   index = "+index)
        // })


        const array = [100,200,300]
        array.forEach( (item,index)=>{
             console.log("item "+item+"   index = "+index)
        })



    </script>



</body>
</html>